﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace JasLib.Interop.Win32
{
    public static partial class USERENV
    {
        [DllImport(Constants.ModuleNames.USERENV, EntryPoint = "CreateProfile", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
        public static extern HRESULT CreateProfile(
            [In, MarshalAs(UnmanagedType.LPWStr)] string pszUserSid,
            [In, MarshalAs(UnmanagedType.LPWStr)] string pszUserName,
            [Out] StringBuilder pszProfilePath,
            [In] uint cchProfilePath);

        [DllImport(Constants.ModuleNames.USERENV, EntryPoint = "DeleteProfileW", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool DeleteProfile(
            [In, MarshalAs(UnmanagedType.LPWStr)] string pszUserSid,
            [In, MarshalAs(UnmanagedType.LPWStr)] string lpProfilePath,
            [In, MarshalAs(UnmanagedType.LPWStr)] string lpComputerName);

        [DllImport(Constants.ModuleNames.USERENV, EntryPoint = "GetProfilesDirectoryW", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool GetProfilesDirectory(
            [Out] StringBuilder lpProfilesDir,
            [In, Out] ref uint lpcchSize);

    }
}
